package com.tuanzi.blog.service.impl;

import com.tuanzi.blog.dao.UserMapper;
import com.tuanzi.blog.model.User;
import com.tuanzi.blog.service.UserService;
import com.tuanzi.blog.util.MD5Utils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 雄关漫道真如铁，而今迈过从头越
 **/

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User checkUser(String username, String password) {

        //这里加密密码
        User user = userMapper.findByUsernameAndPassword(username, MD5Utils.getMD5(password));

        return user;
    }
}
